package com.example.domain.strategy.model.entity;

import com.example.domain.strategy.model.valobj.RuleLogicCheckTypeVO;
import lombok.*;

import java.io.Serializable;


/**
 * @Author: 三石
 * @desc: 规则动作实体 -> 规则过滤的结果
 * @Date: 2024-07-21-13:28
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity> implements Serializable {

    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();
    private String ruleModel;
    private T data;


    /**
     * 下面的三各类也可以单独定义出去
     */
    static public class RaffleEntity {

    }

    // 抽奖之前
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @EqualsAndHashCode(callSuper = true)
    static public class RaffleBeforeEntity extends RaffleEntity {
        /**
         * 策略ID
         */
        private Long strategyId;

        /**
         * 权重值Key；用于抽奖时可以选择权重抽奖。
         */
        private String ruleWeightValueKey;

        /**
         * 奖品ID；
         */
        private Long awardId;
    }

    // 抽奖之中
    static public class RaffleCenterEntity extends RaffleEntity {

    }

    // 抽奖之后
    static public class RaffleAfterEntity extends RaffleEntity {

    }

}
